<template>
    <MrCustom bg-color="bg-gradual-blue " is-back>
      <template #backText>
        返回
      </template>
    </MrCustom>
  <view class="bg-white full-height" v-if="commentInfo">
    <CommentList :list="[commentInfo]" :can-reply="true"></CommentList>
  </view>
</template>

<script setup lang="ts">
import {ref} from "vue";
import {onLoad} from "@dcloudio/uni-app";
import api from "@/api";
import {useUserStore} from "@/store";
import CommentList from "@/components/common/list/CommentList.vue";
import MrCustom from "@/components/common/MrCustom.vue";

const commentReplyInfo = ref()
const commentInfo = ref()
const userStore =useUserStore()

onLoad((option) => {
  commentReplyInfo.value = JSON.parse(decodeURIComponent(option.commentReplyInfo))
  getCommentInfo(commentReplyInfo.value.id)
})

const getCommentInfo = (id: any) => {
  api.comment.commentReplyReadById({
    id: id,
  }).then(res => {
    if (res && res.data.code === 0) {
      commentInfo.value = res.data.data
    }
  })
}




</script>

<style scoped>

</style>